import 'package:flutter/material.dart';

import '../../home_page/widgets/home_page_drawer.dart';
import 'tabbar_items.dart';

class YSHMainPage extends StatefulWidget {
  static const String routeName = '/';
  const YSHMainPage({Key? key}) : super(key: key);

  @override
  State<YSHMainPage> createState() => _YSHMainPageState();
}

class _YSHMainPageState extends State<YSHMainPage> {
  int _currentIndex = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: IndexedStack(
        index: _currentIndex,
        children: pages,
      ),
      bottomNavigationBar: BottomNavigationBar(
        items: items,
        currentIndex: _currentIndex,
        selectedFontSize: 14.0,
        unselectedFontSize: 14.0,
        onTap: (index) {
          setState(() {
            _currentIndex = index;
          });
        },
      ),
      drawer: const YSHHomePageDrawer(),
    );
  }
}
